/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package nominalitzacions.ui;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import nominalitzacions.domain.LanguageDomainController;

/**
 *
 * @author Dani.camacho.rodriguez
 */
public class PairCorpusViewController {
    
    private AddPairCorpusView APCV;
    private RemovePairCorpusView RPCV;
    
    private LanguageDomainController LDC;
    
    public PairCorpusViewController(){
        APCV = new AddPairCorpusView(this);
        RPCV = new RemovePairCorpusView(this);
        try {
            LDC = new LanguageDomainController();
        } catch (IOException ex) {
            
        }
    }
    
    public void setVisibleAdd(boolean a){
        APCV.setVisible(a);
    }
    
    public void setVisibleRemove(boolean a){
        RPCV.setVisible(a);
    }
    
    public void add(String alpha, String beta) throws IOException{
        LDC.savePair(alpha, beta);
        APCV.setVisible(false);
        //System.out.println("Afegir = <"+alpha+", "+beta+">");
    }
    
    public void remove(String alpha, String beta) throws IOException{
        LDC.deletePair(alpha, beta);
        RPCV.setVisible(false);
        //System.out.println("Eliminar = <"+alpha+", "+beta+">");
    }
    
}
